#include <iostream>

using namespace std;
int n, m;
const int N = 4010, MOD = 1e8;
int a[N];
int dp[N][N];
int main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
        for (int j = 0; j < m; j++)
        {
            dp[i][j] = (dp[i - 1][j] + dp[i - 1][((j - a[i] % m) % m + m) % m]) % MOD;
        }

    cout << dp[n][0] - 1 << endl;
    return 0;
}